fix(ollama): use native fetch instead of Tauri HTTP plugin for Windows compatibility#366
Open
linshanzeng wants to merge 1 commit into
Open
fix(ollama): use native fetch instead of Tauri HTTP plugin for Windows compatibility#366linshanzeng wants to merge 1 commit into
linshanzeng wants to merge 1 commit into
Conversation
Owner
|
感谢你专门在 Windows + Ollama 上测这个问题,这个定位很有价值,404 这个现象我们这边之前也确实不好复现。 这个方向我觉得是对的:Ollama 本地服务在桌面端这里确实可以考虑绕开 Tauri HTTP,直接走浏览器原生 fetch。不过现在这个改法会把所有 provider 都强制切到 globalThis.fetch,可能会影响移动端的流式响应,也可能影响 OpenAI/Gemini/自定义 OpenAI-compatible 这些现有配置。 我建议我们把范围收窄一点:只针对桌面端的 Ollama 使用原生 fetch,其他 provider 继续保持现有逻辑。另外 Vite 版本升级和这个修复关系不大,最好也从这个 PR 里拆掉,避免混入不相关变更。 你这个问题提得很好,感谢测试和 PR。我们按这个方向收窄一下的话,我觉得就比较稳了。 |
Author
|
好的,我来按你的意见修改:
我会重新提交修改,只保留 Ollama 相关的改动。 |
f93faec to
b962403
Compare
b962403 to
ffa22d8
Compare
Author
|
已按你的意见修改,只在 Ollama 桌面端的三个位置设置原生 fetch,其他 provider 不受影响。请 review。 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem / 问题
On Windows, Ollama connection fails with 404 error. The root cause is that Tauri's HTTP plugin is incompatible with Ollama's local API.
(Windows 下 Ollama 连接返回 404,原因是 Tauri 的 HTTP 插件不兼容)
Solution / 解决方案
Force using native
fetchinstead of Tauri's HTTP plugin.(强制使用原生 fetch 绕过 Tauri)
Tested / 测试环境